﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Exhibition.Dao.ViewModel;
using Exhibition.Service;

namespace Exhibition.control
{
    public partial class Left : BaseControl
    {
        public StringBuilder sb = new StringBuilder();

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public string GetNews(int start, int num, int navid)
        {
            List<ContentModel> mdls = CenterService.contentService.GetNews(start, num, navid);
            foreach (var m in mdls)
            {
                sb.AppendFormat("<li><a href=\"{0}\" title=\"{1}\">{2}</a></li>", "NewsDetail.aspx?Id=" + m.Id, m.Title, m.Title.Length >= 20 ? m.Title.Substring(0, 20) : m.Title);
            }
            return sb.ToString();
        }
    }
}